home *** CD-ROM | disk | FTP | other *** search
- property numName, foundList, hiddenList, collectList, hinderList, overLayList, saveObjectList, pippi, pippiMate, fence, garden, foundSprite, stopSprite, moveAm, stopRotation, interSectValue, buttonPlayMode, finished, xFrame, stopCounter, thingNumberList, actualGroup
- global autoMoveObject, sndObject, sessionObject
-
- on new me
- xFrame = integer(the frameLabel)
- v = xFrame + 1
- if v = 5 then
- v = 1
- end if
- sessionObject.upCountGmMovie(v)
- stopCounter = the ticks + (15 * 60)
- numName = the frameLabel
- moveAm = [0, 0]
- buttonPlayMode = 1
- hinderList = []
- overLayList = []
- saveObjectList = []
- stopSprite = 0
- stopRotation = 0
- makeFoundList(me)
- finished = 0
- thingNumberList = [[5, 1, 2, 2], [6, 1, 1, 2], [6, 3, 3, 2, 3], [8, 2, 1]]
- actualGroup = 1
- return me
- end
-
- on buildBoat me, meGroup
- thingNumberList[xFrame][meGroup] = thingNumberList[xFrame][meGroup] - 1
- if thingNumberList[xFrame][meGroup] = 0 then
- actualGroup = meGroup + 1
- if actualGroup > thingNumberList[xFrame].count then
- repeat while soundBusy(2) = 1
- end repeat
- t = the ticks + 150
- repeat while the ticks < t
- end repeat
- sound(2).play(member("sail" & string(xFrame), 1))
- go(the frame + 1)
- end if
- end if
- end
-
- on makeFoundList me
- foundList = []
- hiddenList = []
- collectList = []
- repeat with n = 1 to 1000
- if member(n, 1).name.char[1..5] = ("sloa" & numName) then
- startNum = n
- exit repeat
- end if
- end repeat
- repeat with n = startNum to 1000
- if member(n, 1).name.char[1..6] = ("sloa" & numName & "o") then
- foundList[foundList.count + 1] = member(n, 1)
- hiddenList[hiddenList.count + 1] = member(n, 1)
- next repeat
- end if
- exit repeat
- end repeat
- end
-
- on traceCursor me, pPos
- H = pPos[1] - pippi.loc[1]
- v = pPos[2] - pippi.loc[2]
- Offv = v / 2
- if Offv < 0 then
- Offv = Offv * -1
- end if
- vOff = Offv
- Offh = H / 2
- if Offh < 0 then
- Offh = Offh * -1
- end if
- hOff = Offh
- if (H <= vOff) and (H >= (vOff * -1)) then
- leftRight = 0
- else
- if H > vOff then
- leftRight = 1
- else
- leftRight = -1
- end if
- end if
- if (v <= hOff) and (v >= (hOff * -1)) then
- upDown = 0
- else
- if v > hOff then
- upDown = 1
- else
- upDown = -1
- end if
- end if
- if leftRight = 0 then
- if upDown = -1 then
- X = 1
- moveAm = [0, 3]
- else
- if upDown = 1 then
- X = 5
- moveAm = [0, -3]
- end if
- end if
- end if
- if leftRight = -1 then
- if upDown = -1 then
- X = 8
- moveAm = [2, 2]
- else
- if upDown = 1 then
- X = 6
- moveAm = [2, -2]
- else
- X = 7
- moveAm = [3, 0]
- end if
- end if
- end if
- if leftRight = 1 then
- if upDown = -1 then
- X = 2
- moveAm = [-2, 2]
- else
- if upDown = 1 then
- X = 4
- moveAm = [-2, -2]
- else
- X = 3
- moveAm = [-3, 0]
- end if
- end if
- end if
- moveAm = moveAm * 2
- if voidp(X) = 0 then
- rot = (X * 45) - 45
- if pippi.rotation <> rot then
- pippi.rotation = rot
- updateStage()
- if (pippi.playing = 0) and (buttonPlayMode = 1) then
- A = stopRotation - rot
- b = integer(A)
- if b < 0 then
- c = b * -1
- else
- c = b
- end if
- if me.tryFirst() = 1 then
- stopSprite = 0
- moveEveryHopa(me)
- pippi.play()
- updateStage()
- end if
- end if
- end if
- end if
- end
-
- on tryFirst me
- v = 0
- fence.loc = fence.loc + (moveAm * 2)
- repeat with n = 1 to hinderList.count
- hinderList[n].loc = hinderList[n].loc + (moveAm * 2)
- end repeat
- updateStage()
- if pippiMate.intersects(stopSprite) = interSectValue then
- v = 1
- end if
- fence.loc = fence.loc + (moveAm * -1 * 2)
- repeat with n = 1 to hinderList.count
- hinderList[n].loc = hinderList[n].loc + (moveAm * -1 * 2)
- end repeat
- updateStage()
- return v
- end
-
- on walk me
- if pippi.playing = 1 then
- if pippi.member = member("walk", 1) then
- if the ticks > stopCounter then
- if collectList.count = 0 then
- sndObject.respondSnd(1, 7, 1)
- else
- sndObject.respondSnd(1, 1, 1, 1)
- end if
- stopCounter = the ticks + (15 * 60)
- end if
- moveEveryHopa(me)
- end if
- else
- if pippi.member = member("jump", 1) then
- pippi.member = member("walk", 1)
- updateStage()
- pippi.stop()
- pippi.frame = 8
- updateStage()
- end if
- end if
- end
-
- on stopMe me, pSprite, pInterSectValue
- if stopSprite <> pSprite then
- stopRotation = pippi.rotation
- stopSprite = pSprite
- interSectValue = pInterSectValue
- pippi.stop()
- pippi.frame = 8
- end if
- end
-
- on stopFind me, pMember
- sound(3).play(member("sak-pos", 1))
- updateStage()
- repeat with n = 1 to saveObjectList.count
- if saveObjectList[n].member = pMember then
- foundSprite = saveObjectList[n]
- exit repeat
- end if
- end repeat
- foundSprite.locZ = 42
- pippi.member = member("jump", 1)
- updateStage()
- startLoc = stopSprite.loc
- goalLoc = pippi.loc
- divideLoc = goalLoc - startLoc
- amountLoc = divideLoc / 6
- foundSprite.loc = startLoc
- foundSprite.member = pMember
- updateStage()
- repeat with n = 1 to 6
- t = the ticks + 2
- repeat while the ticks < t
- end repeat
- foundSprite.loc = foundSprite.loc + amountLoc
- updateStage()
- end repeat
- foundSprite.locZ = 60
- walk(me)
- repeat while intersect(rect(pippi.loc[1] - 50, pippi.loc[2] - 50, pippi.loc[1] + 50, pippi.loc[2] + 50), foundSprite.rect) > rect(0, 0, 0, 0)
- foundSprite.loc = foundSprite.loc + amountLoc
- updateStage()
- end repeat
- foundSprite.locZ = foundSprite.spriteNum + 30
- updateStage()
- walk(me)
- if foundList.count > 2 then
- sndObject.respondSnd(3, 3, 1, 1)
- else
- if foundList.count = 2 then
- sndObject.respondSnd(1, 6)
- else
- sndObject.respondSnd(1, 2)
- finished = 1
- end if
- end if
- updateStage()
- repeat while soundBusy(2)
- end repeat
- autoMove(autoMoveObject, foundSprite, foundSprite.meLoc)
- foundSprite.locZ = foundSprite.spriteNum + 30
- updateStage()
- foundList.deleteOne(pMember)
- collectList[collectList.count + 1] = pMember
- if finished = 1 then
- go("boat" & numName)
- end if
- stopCounter = the ticks + (15 * 60)
- end
-
- on moveEveryHopa me
- garden.loc = garden.loc + moveAm
- fence.loc = fence.loc + moveAm
- repeat with n = 1 to hinderList.count
- hinderList[n].loc = hinderList[n].loc + moveAm
- end repeat
- repeat with n = 1 to overLayList.count
- overLayList[n].loc = overLayList[n].loc + moveAm
- end repeat
- end
-
- on reportHinder me, pSprite
- hinderList[hinderList.count + 1] = pSprite
- end
-
- on reportHidden me
- v = hiddenList[1]
- hiddenList.deleteAt(1)
- return v
- end
-
- on reportOverLay me, pSprite
- overLayList[overLayList.count + 1] = pSprite
- end
-
- on reportSaveObjectSprite me, pSprite
- saveObjectList[saveObjectList.count + 1] = pSprite
- end
-
- on buttonX me
- buttonPlayMode = 1
- end
-